import os
import time

import yaml

# 获取当前文件路径，拼接yaml配置文件，生成路径，以供下面使用
path = os.path.dirname(__file__)
yaml_file_path = path + '/config.yaml'


def get_config(key):
    data = yaml.safe_load(
        open(yaml_file_path, encoding='utf-8'))
    value = data[key]
    return value


if __name__ == '__main__':
    while 1:
        print(get_config('username'))
        print(get_config('servers'))
        print(get_config('creators'))

        time.sleep(5)
